	var _colsShow = [
			{title: "Name", show: true},
			{title: "Owner", show: true},
			{title: "Last modified", show: true},
			{title: "File size", show: true},
			{title: "Description", show: true},			
		];

	var _orderOption = null;

export default {		
		getColsOption : function(){
			return _colsShow;
		},
		setColsOption : function(colOption){
			_.each(_colsShow, function(_col){
				if (_col.title === colOption.title){
					_col.show = colOption.show;
				}
			});
			console.log(_colsShow);
			this.colsOptionChanged(_colsShow);
		},
		setOrderOption: function(orderOption){
			_orderOption = orderOption;
			this.orderOptionChanged(_orderOption);
		},
		getOrderOption: function(){
			return _orderOption;
		},
		colsOptionChanged: function(callback, on){
			this.someChanged("colsOptionChanged_event", callback, on);
		},
		orderOptionChanged: function(callback, on){
			this.someChanged("orderOptionChanged_event", callback, on);
		},
		someChanged: function(eventName, callback, on) {
			if (typeof callback == "function") {
				if (typeof on == 'undefined' || on) {
					$(this).on(eventName, callback);
				} else {
					$(this).off(eventName, callback);
				}
			} else {
				$(this).trigger(eventName, [callback]);
			}
		}
	};
